{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "import os\n",
    "import sys\n",
    "\n",
    "SRC = os.path.abspath(os.path.join(os.getcwd(), \"../src\"))\n",
    "sys.path.insert(0, SRC)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "import capture\n",
    "import qqchess\n",
    "import numpy as np\n",
    "from matplotlib import pyplot as plt\n",
    "from PIL import Image\n",
    "\n",
    "qqchess.plot_board(qqchess.BOARD, [qqchess.INDEX[qqchess.BOARD[key]] for key in qqchess.BOARD])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "img = qqchess.find_board(Image.open(\"../src/images/qqboard.png\"))\n",
    "pieces, locs = qqchess.make_pieces(img)\n",
    "\n",
    "idxs = []\n",
    "for idx, loc in enumerate(locs):\n",
    "    name = qqchess.BOARD[loc]\n",
    "    idx = qqchess.INDEX[name]\n",
    "    idxs.append(idx)\n",
    "\n",
    "\n",
    "qqchess.plot_board(locs, idxs)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "qqchess.plot_pieces(locs, pieces)"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "test",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.10.9"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
